import java.util.Scanner;

public class a024_最大公因數_GCD {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a, b;
		int temp;
		
		int result = 0;
		
		String output;
		
		while(sc.hasNext()) {
			a = sc.nextInt();
			b = sc.nextInt();
			
			// 把較大數設為a, 較小為b			
			if(b > a) {
				temp = a;
				a = b;
				b = temp;
			}
			
			output = "";
			
			// 
			if(a % b == 0)
				result = b;
			else {
				for(int i = 1; i <= 46341; i++) {
					if(a % i == 0 && b % i ==0)
						result = i;
				}
			}
			
			System.out.println(Integer.toString(result));
		} // next
	} // main
	
}